home *** CD-ROM | disk | FTP | other *** search
- {$B-,D-,F-,I+,N-,R-,S+,V+}
-
- (*
- Timo Salmi UNiT M
-
- A Turbo Pascal unit of keyboad routines.
- All rights reserved 16-Aug-94
-
- This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
- NON-INSTITUTIONAL purposes, provided it is not changed in any way, and
- that a proper attribution is made. For ANY other usage, such as use in a
- business enterprise or at a university, contact the author for the terms
- of registration.
-
- The units are under development. Comments and contacts are solicited. If
- you have any questions, please do not hesitate to use electronic mail for
- communication.
- InterNet address: ts@uwasa.fi
-
- The author shall not be liable to the user for any direct, indirect or
- consequential loss arising from the use of, or inability to use, any unit,
- program or file howsoever caused. No warranty is given that the units and
- programs will work under all circumstances.
-
- Timo Salmi
- Professor of Accounting and Business Finance
- Faculty of Accounting & Industrial Management; University of Vaasa
- P.O. BOX 297, FIN-65101 Vaasa, Finland
- *)
-
- unit TSUNTM;
-
- (* ======================================================================= *)
- interface
- (* ======================================================================= *)
-
- uses Dos
- {$IFDEF VER40}
- ,TSUNT45
- {$ENDIF}
- ;
-
- (* =======================================================================
- Key routines with no Ctr needed
- ======================================================================= *)
-
- (* As Turbo Pascal KeyPressed but does not require the Crt unit *)
- function KEYPREFN : boolean;
-
- (* As Turbo Pascal ReadKey but does not require the Crt unit *)
- function READKEFN : char;
-
- (* Enhanced keyboard ReadKey, no Ctr unit needed. Detects also F11 and F12,
- and distinguishes between the numeric keypad and the gray keys.
- Lower part of the word returns the first scan code, the higher part
- the second, if applicable. *)
- function RDENKEFN : word;
-
- (* This function resembles the traditional Basic inkey function.
- It returns the pressed character with no echo. Special chacarters
- are returned in the usual paired manner (chr(0) + code).
- If timelimit seconds is exceeded timeout becomes true (and a
- chr(0) is returned by inkeyfn). *)
- function INKEYFN (timelimit : real; var timeout : boolean) : char;
-
- (* =======================================================================
- More key routines with no Ctr needed, no key repeat
- ======================================================================= *)
-
- (* Is the left shift key depressed *)
- function LFSHFTFN : boolean;
-
- (* Is the right shift key depressed *)
- function RTSHFTFN : boolean;
-
- (* Is the ctrl key depressed *)
- function CTRLFN : boolean;
-
- (* Is the left ctrl key depressed *)
- function LFCTRLFN : boolean;
-
- (* Is the right ctrl key depressed *)
- function RTCTRLFN : boolean;
-
- (* Is the alt key depressed *)
- function ALTFN : boolean;
-
- (* Is the left alt key depressed *)
- function LFALTFN : boolean;
-
- (* Is the right alt key depressed *)
- function RTALTFN : boolean;
-
- (* Is the SysRq key depressed *)
- function SYSRQFN : boolean;
-
- (* =======================================================================
- Getting keyscan codes
- ======================================================================= *)
-
- (* Every now and then a programmer need to find out the scan codes
- of the keyboard keys. GETSCAN returns the scancode (and the ascii
- value) of the key pressed. For an enhanced AT keyboard use
- GETESCAN. *)
- procedure GETSCAN (var scancode, character : byte);
-
- (* Get scancode and ascii value of a key pressed for an enhanced
- keyboard. To test the presence of an enhanced keyboard use
- ISENHAFN from the TSUNTH unit *)
- procedure GETESCAN (var scancode, character : byte);
-
-